:c variable crumble
:n variable value
:z zero
:g global variable index
:i input
:t temporary
:w working
:a adding aide
:p position

++++++++[->++++++++<]>
[->>>>>>>[>>>>>>>>]+[<<<<<<<<]>]
>>>>>>>[->>>>>>>>]
@i

$i ,[

[- $t>+ $w>+ $i<< ]
$t> [- $i<+ $t>  ]
+

$a>> +++[- $w< ----------- $a>]
 $w< [---
  [ >$a++[- <$w----------- >$a ] $w<
   [ -
    [ -
     [ --
      [ --
       [ $i<< . $t>+++++++[- $w> ++++++++ $t<] $w> [-] ]
       $t< [-
			$p>>>[-] $i<<<<.$n<<<,.[-<[<<]+[>>]<] @n
			$c< [<<]>[-<<<+>>>>[>>] @z $p>>>>>> + $c<<<<<<<< [<<]>]
			<<<[->>>+<<<]>>>>[->>] @z
          $t>>>] $w>
      ]$t< [- $i<.$p>>>>+$t<<< ] $w>
     ]$t< [-  $i<.$p>>>>-$t<<< ] $w>
    ]$t< [[,----------]++++++++++.[-]] $w>
   ]$t< [
			$i<.$n<<<,.[-<[<<]+[>>]<] @n
			$g>> [- $t>>+ $c<<<<<[<<]>+>[>>] @z >]
			$c<<< [<<]>>[->>] @z
			$t>>> [- $g<<+ $t>>]
	 $t]$w>
  ]$t< [-
			$i<.[-]$n<<<,.[-<[<<]+[>>]<] @n
			$c< [<<]>[-<<<+>>>>[>>] @z $i>> + $a>>> + $c<<<<<<< [<<]>]
			<<<[->>>+<<<]>>>>[->>] @z
			<++++++[->++++++++++<]>

			$w>>>>+$p>>[ $a< [-$w<-]<[@w-
				$p>>[-$z<<<<<<.$p>>>>>>] +  $t<<<] $w>+$p>>-]
			$z<<<<<<++$w>>>>-$a>[-$z<<<<<.$a>>>>>]$z<<<<<[-]
			$i>>[-$p>>>>+$i<<<<]
    $t>] $w>
 ]$t< [- remove var ] $w>
$i<<,]
